package Eyjafjalla.action;

import Eyjafjalla.panel.CloudEnergyPanel;
import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.common.GainEnergyAction;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.ui.panels.EnergyPanel;

public class FairyAction extends AbstractGameAction {
    public FairyAction(int amount){
        this.amount = amount;
    }

    @Override
    public void update() {
        int energy = EnergyPanel.getCurrentEnergy();
        int cloudEnergy = CloudEnergyPanel.getCurrentEnergy();
        if(cloudEnergy<=energy){
            addToTop(new GainCloudEnergyAction(this.amount));
        }
        if(energy<=cloudEnergy){
            addToTop(new GainEnergyAction(this.amount));
        }

        this.isDone = true;
    }
}
